<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    :confirmLoading="confirmLoading"
    switchFullscreen
    @cancel="handleCancel"
    :body-style="{
      padding: '10px'
    }"
    cancelText="关闭"
  >
    <div>
      <a-form-model :labelCol="labelCol" :wrapperCol="wrapperCol" :model="form">
        <a-form-model-item label="品名" prop="materialName">
          <HfMaterialSearchSelectTag
            v-model="form.materialName"
            dataUrl="/sale/hfSalePrice/getSalePriceByCustom"
            @change="onMaterialChange(arguments)"
          ></HfMaterialSearchSelectTag>
        </a-form-model-item>
      </a-form-model>
    </div>

    <template #footer>
      <a-button type="danger" @click="handleCancel">取消</a-button>
      <a-button type="primary" @click="handleOk">生成领料单</a-button>
    </template>
  </j-modal>
</template>

<script>
import HfMaterialSearchSelectTag from '@comp/HfManual/HfMaterialSearchSelectTag.vue'

export default {
  name: 'HfGenerateModal',
  components: { HfMaterialSearchSelectTag },
  props: {
    title: {
      type: String,
      default: ''
    },
    width: {
      type: Number,
      default: 1200
    }
  },
  computed: {
    labelSpan() {
      return {}
    }
  },
  data() {
    return {
      visible: false,
      confirmLoading: false,
      labelCol: {},
      wrapperCol: {},
      form: {}
    }
  },
  methods: {
    handleCancel() {
      this.close()
    },
    handleOk() {
      this.close()
    },
    open() {
      this.visible = true
    },
    close() {
      this.visible = false
    }
  }
}
</script>

<style scoped></style>
